﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Core.Interfaces;
using Core.Interfaces.IPresenters;
using Core.Unity;
using Microsoft.Practices.Unity;

namespace Core.Controls
{
    public partial class PrivatPersonControll : UserControl, ICustomerControl
    {
        private IPrivatePerson _privatePerson;

        public PrivatPersonControll()
        {
            InitializeComponent();
        }

        public PrivatPersonControll (bool inProgramm,IPrivatePerson privatePerson)
        {
            InitializeComponent();
            if (privatePerson == null && inProgramm )
            {
                _privatePerson = ResolverContainer.Resolver.Resolve<IPrivatePerson>();
            }
            if (inProgramm)
            {
                iPrivatePersonBindingSource.DataSource = _privatePerson;
            }
            
        }


        public BindingSource AdditionalModel
        {
            get { return iPrivatePersonBindingSource; }
            set { iPrivatePersonBindingSource = value; }
        }
    }
}
